Embodiments presented in this disclosure generally relate to database indexes and, more particularly, to techniques for indexing keys containing timestamp data and time zone data.
Databases are computerized information storage and retrieval systems. A relational database management system is a computer database management system (“DBMS”) that uses relational techniques for storing and retrieving data. An object-oriented programming database is a database that is congruent with the data defined in object classes and subclasses. Regardless of the particular architecture, a requesting entity (e.g., an application or the operating system) in a DBMS requests access to a specified database by issuing a database access request. Such requests may include, for instance, simple catalog lookup requests or transactions and combinations of transactions that operate to read, change and add specified records in the database. These requests (i.e., queries) are often made using high-level query languages such as the Structured Query Language (“SQL”). Upon receiving such a request, the DBMS may execute the request against a corresponding database, and return any result of the execution to the requesting entity.
Information is typically retrieved from a database using database queries. A query usually specifies conditions that apply to one or more columns of the database and may specify logical operations to be performed that involve multiple columns. In processing such a query, the DBMS generally searches the database for records that satisfy the conditions specified by the query and returns those records as query results for the query. One way to improve the performance of a query is to use a database index. A database index is generally a data structure that allows data in the database (e.g., in a table) to be located and accessed more efficiently. A query optimizer within the DBMS may evaluate a query and determine that building an index for a table will help the query run faster. The query optimizer could then generate the index, which could be used in both the processing of the current query and in processing subsequent queries against the table as well.